SuperStrict

Include "TGame.bmx"

Type tTestEntity Extends tEntity
	Method New()
		BasicInit()
	End Method
	
	Method Test()
		Listeners.OnEvent("Test")
	End Method
End Type

Type tTestListener Extends tEventListener
	Method OnListenerCalled(eData:tEventData Var)
		Local name:String = eData.Name
		Local data:Object = eData.data
		Select name
			Case "Test"
				Print "Test Called"
		End Select
	End Method
End Type

Local lTestEntity:tTestEntity = New tTestEntity
Local lTestListener:tTestListener = New tTestListener
Local lTestListener2:tTestListener = New tTestListener
Local lTestEntity2:tTestEntity = lTestEntity gGame.GetEntitySystem().GetEntityById(lTestEntity.id)
gGame.GetEntitySystem().Register(lTestEntity)
gGame.GetEventSystem().RegisterEventListener(lTestEntity, lTestListener)
gGame.GetEventSystem().RegisterEventListener(lTestEntity2, lTestListener)
Print (lTestEntity.id)
lTestEntity.Test()
